#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int B(int n)
{
	if (n == 1)
		return 0;
	int a = n / 2;
	n = n % 2 + a;
	return a + B(n);

}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int f = n;
	int s = B(n);
	printf("%d\n", f + s);
	return 0;
}
